WorldWindow

open class WorldWindow(val canvas: HTMLCanvasElement, renderResourceCache: RenderResourceCache = RenderResourceCache(), prepareEvent: PrepareEventHandler = createDefaultPrepareEventHandler(canvas)) : WorldWind.EventListener

Represents a WorldWind window for an HTML canvas.

Constructors

Link copied to clipboard
constructor(canvas: HTMLCanvasElement, renderResourceCache: RenderResourceCache = RenderResourceCache(), prepareEvent: PrepareEventHandler = createDefaultPrepareEventHandler(canvas))

Types

Link copied to clipboard
object Companion
Link copied to clipboard

Properties

Link copied to clipboard

The HTML canvas associated with this WorldWindow.

Link copied to clipboard

The controller used to manipulate the globe.

Link copied to clipboard
open val engine: WorldWind

Main WorldWind engine, containing globe, terrain, renderable layers, camera, viewport and frame rendering logic.

Link copied to clipboard

The controller used to manipulate the globe with the keyboard.

Link copied to clipboard

The list of callbacks to call immediately before and immediately after performing a redrawn. The callbacks have two arguments: this WorldWindow and the redraw stage, e.g., redrawCallback(worldWindow, stage);. The stage will be either WorldWind.BEFORE_REDRAW or WorldWind.AFTER_REDRAW indicating whether the callback has been called either immediately before or immediately after a redrawn, respectively. Applications may add functions to this array or remove them.

Link copied to clipboard

Renderable selection and drag gestures detector. Assign SelectDragDetector.callback to handle events.

Functions

Link copied to clipboard
fun addEventListener(type: String, listener: (Event) -> Unit)

Registers an event listener for the specified event type on this WorldWindow's canvas. This function delegates the processing of events to the WorldWindow's canvas. For details on this function and its arguments, see the W3C org.w3c.dom.events.EventTarget documentation.

Link copied to clipboard
fun canvasCoordinates(x: Number, y: Number): Vec2

Converts window coordinates to coordinates relative to this WorldWindow's canvas.

Link copied to clipboard
fun pick(pickPoint: Vec2): PickedObjectList

Requests the WorldWind objects displayed at a specified screen-coordinate point.

Link copied to clipboard
fun pickShapesInRegion(x: Double, y: Double, width: Double = 0.0, height: Double = 0.0, pickCenter: Boolean = true): PickedObjectList

Requests the WorldWind objects displayed within a specified screen-coordinate region. This returns all objects that intersect the specified region, regardless of whether an object is actually visible, and marks objects that are visible as on top.

Link copied to clipboard
fun removeEventListener(type: String, listener: (Event) -> Unit)

Removes an event listener for the specified event type from this WorldWindow's canvas. The listener must be the same object passed to addEventListener. Calling removeEventListener with arguments that do not identify a currently registered listener has no effect.

Link copied to clipboard
open override fun requestRedraw()

Causes this WorldWindow to redraw itself at the next available opportunity. The redrawn occurs on the main thread at a time of the browser's discretion. Applications should call redraw after changing the World Window's state, but should not expect that change to be reflected on screen immediately after this function returns. This is the preferred method for requesting a redrawn of the WorldWindow.

Link copied to clipboard
open override fun unmarkResourceAbsent(resourceId: Int)

Removes resource ID from the missed resource list